﻿Imports EDMDesigner.Business
Imports System.Xml.Linq

Imports <xmlns="http://schemas.microsoft.com/ado/2007/06/edmx">
Imports <xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx">

Module WriterDesigner
    Friend Function WriteDesigner(ByVal edm As EDM) As XElement
        Return <edmx:Designer xmlns="http://schemas.microsoft.com/ado/2007/06/edmx">
                   <edmx:Connection>
                       <DesignerInfoPropertySet>
                           <%= From dp In edm.DesignerProperties _
                               Select <DesignerProperty Name=<%= dp.Name %> Value=<%= dp.Value %>/> %>
                       </DesignerInfoPropertySet>
                   </edmx:Connection>
                   <edmx:Options>
                       <DesignerInfoPropertySet>
                           <%= From dp In edm.DesignerProperties _
                               Select <DesignerProperty Name=<%= dp.Name %> Value=<%= dp.Value %>/> %>
                       </DesignerInfoPropertySet>
                   </edmx:Options>
                   <edmx:Diagrams>
                       <%= edm.EDMXDesignerDiagrams %>
                   </edmx:Diagrams>
               </edmx:Designer>
    End Function
End Module
